package com.example.educationplatformbackend.controller;

import com.example.educationplatformbackend.domian.home.Coutsenew;
import com.example.educationplatformbackend.domian.home.Recommend;
import com.example.educationplatformbackend.service.Impl.HomeService;
import com.example.educationplatformbackend.utils.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
public class homeController {


    @Autowired
    private HomeService homeService;


    @GetMapping("homepagecarousel")
    public ResponseResult<List<String>> homepagecarousel(){
        return ResponseResult.success(homeService.HomepageCarousel());
    }


    @GetMapping("recommend")
    public ResponseResult<List<Recommend>> recommend(){
        return ResponseResult.success(homeService.recommend());
    }




    @GetMapping("coutsenew")
    public ResponseResult<List<Coutsenew>> coutsenew(@RequestParam(value = "type", required = false) String type){
        return ResponseResult.success(homeService.coutsenew(type));
    }
}
